/**
 @file        Infrasound.VDM.History.h
 @ingroup     libVDM						
 @brief       history for network data segments
 @version     $0.1$					
 @since       1.0
 @author      Andreas Schlueter

 

 $Id$
 */


#ifndef VDM_HISTORY
#define VDM_HISTORY

#include <Infrasound.VDM.h>

/**
 * segement status in history
 */
enum segment_status{
	UNKNOWN=0,		///< no entry for segment exists
	UNCONFIRMED=1,	///< segment is unconfirmed, entry overwritable (written to SD)
	LOCKED=2,		///< segment exists and entry is not overwritable, because it is in RAM
	CONFIRMED=3		///< segment is confirmed, entry overwritable
};




/**
 * @brief marks all entries as overwritable
 */
void history_init();

/**
 * @brief confirms history entry
 *        note: the according segment in RAM will be removed
 *
 * @return status after operation
 */
enum segment_status history_confirm(segment_key_t id);

/**
 *  @return status of a history entry
 */
enum segment_status history_segmentState(segment_key_t id);
#endif 

